<template>
    <div>
        <!-- <DemoMixin1>111</DemoMixin1> -->
        <DemoMixin0 ref="demo" :aaa="platform == 'MOBILE'">222</DemoMixin0>
        <!-- <el-button @click="delete0">卸载0</el-button> -->
        <!-- <el-input :value="ismobile"></el-input> -->
        <!-- <el-input :value="platform"></el-input> -->
        <el-button @click="open" :aaa="platform">mixinsa</el-button>
    </div>
</template>
<script>
import DemoMixin0 from '@/components/DemoMixin0.vue'

export default {
    asyncData({ isDev, route, store, env, params, query, req, res, redirect, error }) {
        console.log('asyncData-params', params)
    },
    name: 'demoMixin2',
    props: ['args0'],
    // mixins: [mixinsa],

    components: {
        DemoMixin0
    },
    data() {
        return {
            show0: true
        }
    },
    beforeCreate() {
        // console.log('【page】-beforeCreate-getPageTitle', this.$store.getters.pageTitle)
        // console.log('【page】-beforeCreate-getMiddleTitle', this.$store.getters.middleTitle)

        // console.log('beforeCreate-getTitle', this.$store.getters.title)
        // localStorage.setItem('setPageTitle2', '123')
    },
    created() {
        // console.log('【page】-create-getPageTitle', this.$store.getters.pageTitle)
        // console.log('【page】-create-getMiddleTitle', this.$store.getters.middleTitle)
    },
    mounted() {
        this.$refs.demo.say()
        this.$store.commit('setPageTitle', 22)

        // console.log('props', this.args0)
        // console.log('localStorage-getTitle', localStorage.getItem('vuex'))

        // this.$axios
        //     .get("https://www.baidu.com/s?ie=UTF-8&wd=%E7%99%BE%E5%BA%A6", { fromUserId: 'ccc' })
        //     .then((res) => {
        //         console.log('buildConnection-res', res)
        //     });
        // https://zhikujiapu.oss-cn-hangzhou.aliyuncs.com/%E8%90%A7%E5%B1%B1%E4%B8%9B%E4%B9%A6%E7%AC%AC%E4%BA%8C%E8%BE%9101%E5%86%8C.pdf
        let url = '/%E8%90%A7%E5%B1%B1%E4%B8%9B%E4%B9%A6%E7%AC%AC%E4%BA%8C%E8%BE%9101%E5%86%8C.pdf'
        this.$axios.get(
            url,
            {
                responseType: 'blob',
                onDownloadProgress(progress) {
                    console.log(Math.round(progress.loaded / progress.total * 100) + '%');
                },
                // onDownloadProgress: function (event) { // 下载进度监听
                //     console.log('event == ', event.loaded)
                //     console.log('event == ', event.total)
                //     if (event.loaded === event.total) {
                //         // 下载完成 loading = true

                //     }
                // }
            }
        ).then(res => {
            console.log('res == ', res)
        }).catch(error => {
            console.log(error)
        })
    },
    methods: {
        open() {
            window.open('/DemoMixin2')
        },
        delete0() {
            this.show0 = false
        }
    },
}
</script> 

<style scoped></style>
